﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ComUIControl
{
    public class WaitingBox
    {
        private static bool isActivated = false;
        private static FormOnWaitting _wnd;
        public static void Show(string waitInfo)
        {
            if (!isActivated)
            {
                _wnd = new FormOnWaitting();
                _wnd.SetTip(waitInfo);
                _wnd.Show();
                isActivated = true;
            }
            else
            {
                _wnd.SetTip(waitInfo);
            }
        }

        public static void Close()
        {
            if (isActivated)
            {
                _wnd.Close();
                _wnd.Dispose();
                isActivated = false;
            }
        }
    }
}
